package pl.jdeveloper.derivato.web.form;

import org.apache.wicket.extensions.markup.html.form.select.Select;
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.markup.html.form.TextField;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.PropertyModel;

import pl.jdeveloper.derivato.bean.Calculation;

public class CalculationForm extends Form{
	
	private static final long serialVersionUID = 6007407054326397672L;
	
	private TextField formula;
	private TextField x;
	private TextField h;
	private Select difference;
	private Select diffClass;
	private TextField scale;
	
	public CalculationForm(String id, IModel model) {
		super(id, model);
		formula = new TextField("formula", new PropertyModel(model,"formula"));
		x = new TextField("x", new PropertyModel(model,"x"));
		h = new TextField("h", new PropertyModel(model,"h"));
		difference = new Select("difference", new PropertyModel(model,"difference"));
		diffClass = new Select("diffClass", new PropertyModel(model, "diffClass"));
		scale = new TextField("scale", new PropertyModel(model,"scale"));
		add(formula);
		add(x);
		add(h);
		add(difference);
		add(diffClass);
		add(scale);
	}

	@Override
	protected void onSubmit() {
		Calculation calc = (Calculation) getModel().getObject();
		
	}

	
	

}
